'use strict';

const { Controller } = require('ee-core');
const Log = require('ee-core/log');
const Services = require('ee-core/services');
const { resOk } = require("../utils/tools");

/**
 * 部门机构 Controller
 */

class deptController extends Controller {
	constructor(props) {
		super(props);
	}

	// 异步   同步


	async getAllDepts() {
		
		let res = await Services.get('dept').getAllDepts()
		return res
	}


	async getDeptTreeData() {
		let res = await Services.get('dept').getDeptTreeData()
		return res
	}

	async uploadExcel(data){
		Log.info('uploadExcel', data)
		let res = await Services.get('dept').uploadExcel(data)
		return res
	}

	async getUser(){
		let res = await Services.get('dept').getUser()
		return res
	}

	async deleteDept(data){
		let res = await Services.get('dept').deleteDept(data)
		return res
	}

	async clearCache(){
		let res = await Services.get('dept').clearCache()
		return res
	}

	async reloadUserPinyin(){
		let res = await Services.get('dept').reloadUserPinyin()
		return res
	}
}


deptController.toString = () => '[class deptController]';
module.exports = deptController;
